package api

import (
	"github.com/gin-gonic/gin"
	"live-broadcast_07_23/api/handler"
	"live-broadcast_07_23/api/middleware"
)

func LoadRouter(r *gin.Engine) {
	api := r.Group("/api")
	{
		user := api.Group("/user")
		{
			user.POST("register", handler.RegisterUser)
			user.POST("login", handler.LoginUser)
			user.GET("list", handler.ListUploadUser)
		}

		auth := api.Group("/auth")
		{
			auth.Use(middleware.Auth())
			auth.POST("upload", handler.UploadAuth)
			auth.GET("list", handler.ListUpload)
			auth.POST("deleteUpload", handler.DeleteUploadAuth)
			auth.GET("showUpload", handler.ShowUploadAuth)
		}
	}
}

/*

 binding:"required"
*/
